import type { Directive, DirectiveBinding } from "vue";

/**
 *
 * @param el
 * @param binding
 * v-input.green 设置颜色为绿色
 * v-input.red 设置颜色为红色
 */
const vColor: Directive = (el: HTMLElement, binding: DirectiveBinding) => {
    if(binding.modifiers.green){//绿色
        el.style.color = '#88D16C';
    }
    if(binding.modifiers.red){//红色
        el.style.color = '#f00';
    }
    if(binding.modifiers.yellow){//黄色
        el.style.color = '#F8DA62';
    }
    if(binding.modifiers.blue){//蓝色
        el.style.color = '#3E90F7';
    }
}

export default vColor;